Interface sjl.Function1
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface sjl.Function1

public interface Function1
extends Object
Defines the interface for function object that takes one parameter. A function object is an object that can understand the perform(Object) message. Function objects are used by many of the algorithms, ex: for_each. You must implement the actual function object with code like this:
public class Print implements Function1 {
    public Object perform(Object each) {
        System.out.println(each.toString());
        return null;
    }
}
This class will, when used with the for_each function print each element of the container.

Copyright © 1996 Finn Bock

See Also:
Function0, Function2

Method Index

 o perform(Object)
This method is executed for each call to the function object.

Methods

 o perform
  public abstract Object perform(Object o)
This method is executed for each call to the function object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index